Human emotion detection

ABSTRACT

Disclosed herein are system, method, and computer program product embodiments for recognizing a human emotion in a message. An embodiment operates by receiving a message from a user. The embodiment labels each word of the message with a part of speech (POS) thereby creating a POS set. The embodiment determines an incongruity score for a combination of words in the POS set using a knowledgebase. The embodiment determines a preliminary emotion detection score for an emotion for the message based on the POS set. Finally, the embodiment calculates a final emotion detection score for the emotion for the message based on the preliminary emotion detection score and the incongruity score.

RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.16/783,304, filed on Feb. 6, 2020, now allowed, which is a continuationof U.S. patent application Ser. No. 16/395,939, entitled “Human EmotionDetection,” filed on Apr. 26, 2019, now U.S. Pat. No. 10,592,609, whichare herein incorporated by reference in their entirety.

TECHNICAL FIELD

This disclosure generally relates to human emotion detection, and morespecifically to humor detection.

BACKGROUND

Systems that interact directly with human beings are increasingly usingartificial intelligence to recognize and generate human emotions. Forexample, personal digital assistants are increasingly using artificialintelligence to recognize human emotions so that they can respond moreeffectively to users. Similarly, customer relationship management (CRM)bots are increasingly using artificial intelligence to recognize humanemotions to provide improved interactions with customers. But thesesystems often suffer from various technological problems. First, thesesystems often rely on seeing the entire user input to recognize humanemotions. This need to see the entire user input can often be expensivein terms of memory usage and computation time. Second, these systemsoften suffer from a long delay between receiving the user input andactually recognizing human emotions contained therein. Finally, thesesystems are often poor at predicting the presence of various humanemotions. For example, these systems are often unable to predict thepresence of humor.

SUMMARY

The present disclosure provides system, apparatus, method, and computerprogram product embodiments, and combinations and sub-combinationsthereof, for recognizing human emotions in a user input.

In some embodiments, a message can be received from a user. Each word ofthe message can then be labeled with a part of speech (POS) therebycreating a POS set. A bag of words (BOW) can then be created for themessage. A incongruity score can then be determined for a combination ofwords in the POS set using a knowledgebase. A preliminary emotiondetection score for an emotion of the message can then be determinedbased on the POS set and the BOW. Finally, a final emotion detectionscore for the emotion for the message can be calculated based on thepreliminary emotion detection score and the incongruity score. The useof an incongruity score together with a preliminary emotion detectionscore can substantially increase the accuracy of human emotiondetection. The use of an incongruity score together with a preliminaryemotion detection score can also reduce the memory usage and thecomputation cost associated with detecting human emotion in a userinput.

In some embodiments, the message can be text data, visual data, or audiodata. The message can be converted from audio data or visual data totext data for detection of different human emotions. This conversion totext data enables the detection of different human emotions in speeches,images, videos, or various other types of mediums as would beappreciated by a person of ordinary skill in the art.

In some embodiments, a contextual clue score, a frame of referencescore, and a personal frame of reference score can be determined basedon the POS set and the BOW. A preliminary emotion detection for humorcan be determined based on the contextual clue score, the frame ofreference score, and the personal frame of reference score. The use of acontextual clue score, a frame of reference score, and a personal frameof reference score can provide improved detection of humor in a messagecompared to conventional systems.

In some embodiments, a second preliminary emotion detection score for asecond emotion can be determined for the message based on the POS setand the BOW. A second final emotion detection score for a third emotionfor the message can be determined based on the original preliminaryemotion detection score, the second preliminary emotion score, and theincongruity score. The use of multiple preliminary emotion scoresenables the accurate detection of other types of human emotion that areoften unable to be detected by conventional systems.

Other features of the present disclosure will be apparent from theaccompanying drawings and from the detailed description.

BRIEF DESCRIPTION OF THE DRAWINGS

Embodiments of the disclosure are described with reference to theaccompanying drawings, which are incorporated herein and form a part ofthe specification. In the drawings, generally, like reference numbersindicate identical or functionally similar elements. Additionally,generally, the left most digit(s) of a reference number identifies thedrawing in which the reference number first appears.

FIG. 1 is a block diagram of a system for detecting a human emotion in amessage from a user, according to some embodiments.

FIG. 2 is a block diagram of human emotion detection system fordetecting a human emotion in a message from a user, according to someembodiments.

FIG. 3 is a block diagram of a humor engine for detecting humor in amessage, according to some embodiments.

FIG. 4 is a block diagram of contextual clue module for determining acontextual clue score for a message, according to some embodiments.

FIG. 5 is a block diagram of frame of reference module for determining aframe of reference score for a message, according to some embodiments.

FIG. 6 is a block diagram of personal frame module for determining apersonal frame for a receiver of a message, according to someembodiments.

FIG. 7 is a flowchart illustrating a process for detecting a humanemotion in a message from a user, according to some embodiments.

FIG. 8 is an example computer system useful for implementing variousembodiments.

DETAILED DESCRIPTION

As introduced previously, provided herein are system, apparatus, device,method and/or computer program product embodiments, and/or combinationsand sub-combinations thereof, for recognizing human emotions in a userinput.

A system that interacts directly with a human being often wants torecognize a human emotion. For example, a customer relationshipmanagement (CRM) bot may want to detect if a customer is happy orunhappy during their interaction with the bot. The bot can then changeits behavior based on the detected human emotion.

Conventional approaches to recognizing human emotions in a user inputsuffer from several technological problems. First, conventionalapproaches often involve processing the entire user input (or a largeportion thereof) before returning a detected human emotion containedtherein. For example, in the case of a CRM bot, the bot may process anentire chat with a customer before determining the presence of a humanemotion in the chat. But this need to see the entire user input canoften be expensive in terms of memory usage and computation time. Thiscan be especially true if the system is simultaneously processing manyuser inputs.

Second, this need to see the entire user input can cause a long delaybetween receiving the user input and actually recognizing human emotionscontained therein. For example, a CRM bot often needs to determine thepresence of a human emotion on demand rather than a long time after thehuman emotion actually occurred.

Finally, conventional systems are often poor at predicting the presenceof various human emotions in a user input. For example, conventionalapproaches are often very poor at predicting the presence of humor in auser input.

Embodiments herein solve these technological problems by detecting humanemotions in a user input based on incongruities in the user input. Thiscan reduce the need to process the entire user input up front beforereturning the detected human emotion. This can also reduce memory usageand the computation cost associated with detecting human emotion in auser input.

Embodiments herein further solve these technological problems bydetecting a human emotion in a user input based on the presence ofvarious other human emotions in the user input. This can improve theaccuracy of detection. This can also enable the detection of previouslyundetectable types of human emotion such as love, avarice, guilt, shame,contempt, disgust, sadness, or surprise.

Finally, embodiments herein solve the technological problem ofaccurately detecting humor in a user input using an objective humormodel.

FIG. 1 is a block diagram of a system 100 for detecting a human emotionin a message from a user, according to some embodiments. System 100 caninclude client device 102, human emotion detection system 106, and aknowledgebase 108.

Client device 102 can be any of a personal digital assistant (PDA),desktop workstation, laptop or notebook computer, netbook, tablet, smartphone, smart watch or other wearable, appliance, part of theInternet-of-Things, and/or embedded system, to name a few non-limitingexamples, or any combination thereof. Client device 102 can also be aserver computer.

Client device 102 can be any system that directly interacts with a user(e.g., a human being). Client device 102 can receive a message from theuser. The message can be text, audio, or visual data. Client device 102can then provide the message to human emotion detection system 106 todetect the presence of a human emotion in the message.

Client device 102 can be operated by a business, organization, or otherentity. For example, client device 102 can be operated by a businessthat wants to detect the presence of a human emotion in a message from acustomer.

Human emotion detection system 106 can receive the message from clientdevice 102 over network 104. Network 104 can include, withoutlimitation, wired and/or wireless intranet, extranet, Internet,cellular, Bluetooth and/or any other local, short range, ad hoc,regional, global communications network, as well as any combinationthereof.

Human emotion detection system 106 can detect a human emotion in themessage using knowledgebase 108. Knowledgebase 108 can be a database.Knowledgebase 108 can store information for analyzing the message forthe presence of different human emotions. For example, knowledgebase 108can store one or more bag of words (BOWs), common linguisticcharacterizations (e.g. words and phrases commonly known to relate to aparticular human emotion), word attributes, or other emotionallyrelevant data as would be appreciated by a person of ordinary skill inthe art.

Human emotion detection system 106 can receive the message using anapplication programming interface (API). For example, human emotiondetection system 106 can receive the message using a RepresentationalState Transfer (REST) API. As would be appreciated by a person ofordinary skill in the art, human emotion detection system 106 canreceive the message using various other types of API.

The API can provide a way for client device 102 to query human emotiondetection system 106 for the presence of different human emotions in themessage. In response, human emotion detection system 106 can return oneor more detected human emotions for the message. This can allow clientdevice 102 (or a user of client device 102) to determine whether humanemotion detection system 106 detected different human emotions in themessage that a user previously inputted.

FIG. 2 is a block diagram of human emotion detection system 106 fordetecting a human emotion in a message from a user, according to someembodiments. FIG. 2 is described with reference to FIG. 1 . Humanemotion detection system 106 can include sensor 202, linguistic analyzer204, incongruity detector 206, emotion engines 208, compiler 218, andoptionally converter 203 and trainer 220.

Sensor 202 can receive the message from client device 102. Sensor 202can receive the message using an API such as, but not limited to, theREST API. Sensor 202 can receive the message as a query string using theAPI. The message can be any message for which human emotion detectionsystem 106 can detect the presence of one or more human emotions.

Human emotion detection system 106 can detect the presence of one ormore human emotions in a message associated with different real worldapplications. For example, human emotion detection system 106 can detectthe presence of one or more human emotions in reviews and surveyresponses from a user. Human emotion detection system 106 can detect thepresence of one or more human emotions in online and social mediamessages. Human emotion detection system 106 can detect the presence ofone or more human emotions in user interactions received by a personaldigital assistant such as Google's personal digital assistant, AmazonAlexa, Apple Siri, or Microsoft Cortana. Human emotion detection system106 can detect the presence of one or more human emotions in a customermessage received by a shopping bot. Human emotion detection system 106can detect the presence of one or more human emotions in a customermessage received by a CRM bot. Human emotion detection system 106 can beused to detect the presence of one or more human emotions in a messageassociated with various other real world applications as would beappreciated by a person of ordinary skill in the art.

Sensor 202 can receive the message in various formats. For example,sensor 202 can receive a text message from client device 102. Sensor 202can also receive an audio message from client device 102. Sensor 202 canalso receive a visual message from client device 102 (e.g., an image orvideo). As would be appreciated by a person of ordinary skill in theart, the message can be a message received in real time or a recordedmessage.

Sensor 202 can send the message to converter 203 to convert the messageinto a text format for processing by human emotion detection system 106.For example, converter 203 can convert an audio message into a textmessage using a speech-to-text conversion scheme. Converter 203 can alsoconvert a visual message into a text message using optical characterrecognition (OCR). Converter 203 can translate the visual message into atext message using various other techniques as would be appreciated by aperson of ordinary skill in the art. As would be appreciated by a personof ordinary skill in the art, converter 203 can be a part of humanemotion detection system 106 or accessible by human emotion detectionsystem 106 at an external system.

After receiving the message, and converting the messages into a textformat (if necessary), sensor 202 can provide the message to linguisticanalyzer 204. Linguistic analyzer 204 can perform linguistic analysis onthe text of the message. Linguistic analyzer 204 can identify the partof speech (POS) of the words of the message. For example, linguisticanalyzer 204 can identify the nouns, verbs, and modifiers of the wordsof the message. Linguistic analyzer 204 can label the words of themessage based on their corresponding POS. This labeled set of words canbe referred to as a POS set.

Linguistic analyzer 204 can also create a bag of words (BOW) for thewords of the message. The BOW can represent each word in the messagetogether with its corresponding frequency of occurrence. The BOW candisregard grammar and word order but keep multiplicity.

Linguistic analyzer 204 can output the POS set to incongruity detector206 and emotions engine 208. Linguistic analyzer 204 can also output theBOW to incongruity detector 206 and emotions engine 208.

Incongruity detector 206 can determine one or more incongruity scoresfor different combinations of words in the POS set. An incongruity canbe a state in which a combination of words are inconsistent with eachother. An incongruity score can represent the degree to which the wordsare inconsistent with each other. Human emotion detection system 106 canuse the one or more incongruity scores to more accurately detect a humanemotion in the message. This is because the presence of an incongruityin the message can be a factor in whether a particular human emotion ispresent in the message or not.

Incongruity detector 206 can determine an incongruity score for acombination of words in the POS set using knowledgebase 108.Knowledgebase 108 can be a database. Knowledgebase 108 can store knownword associations and frequencies. For example, knowledgebase 108 canstore POS, word attributes, humor signifiers, euphoria signifiers,dysphoria signifiers, fear signifiers, references, user attributes,aural inflections, visual exposition, and machine learning information.

Word attributes can be words descriptive of or associated with aconcept. For example, the words wet, cold, and blue can be descriptiveof water.

Humor signifiers can be words and phrases found to be humorous oraccompanying humorous words or phrases. Euphoria signifiers can be wordsand phrases that have been shown to be significant indicators ofeuphoric emotions. such as, but not limited to, love, joy, orcompassion. Dysphoria signifiers can be words and phrases that have beenshown to be significant indicators of dysphoric emotions, such as, butnot limited to, hate, jealousy, or sadness. Fear signifiers can be wordsand phrases that have been shown to be significant indicators of thefear emotion.

References can include databases of categorized word lists related to,but not limited to, movies, music, or pop culture. User attributes caninclude demographic and user information provided by user sessionvariables (e.g., web browser cookies) or other computer aidedidentification and behavioral attribution techniques by consumer datacompanies (e.g., Facebook, Inc. and Google LLC). Collected informationbased on the interactions with the system during use.

Aural inflections can include known tonal and rhythmic changes thatsignify psychological conditions. Visual expositions can includedescription of the scene in which the action takes place in a visualmedium such as, but not limited to, photographs and video. Machinelearning information can include results of previous machine learneddata, predictive algorithms, and scripts running inferential statisticssuch as regressions.

Knowledgebase 108 can also store numerous other speech-relatedinformation, such as listings of jokes, movie quotations, song lyrics,and/or previously-learned word associations, to provide some examples.Knowledgebase 108 can be managed by a different entity than the entitythat manages human emotion detection system 106. Human emotion detectionsystem 106 can access knowledgebase 108 over network 104.

Incongruity detector 206 can determine an incongruity score for acombination of words in the POS set by calculating different variablesfor the combination of words using the information in knowledgebase 108.Incongruity detector 206 can calculate a collocate variable for thecombination of words using the information in knowledgebase 108. Forexample, organic can collocate with food, matter, product, natural,material, compound, etc. The collocation variable can be a value between0 and 1. The collocation variable can represent the degree to which thesequence of words in the combination of words co-occur more often thanwould be expected by chance.

Incongruity detector 206 can also calculate a correlation variable forthe combination of words using the information in knowledgebase 108. Thecorrelation variable can be a value between 0 and 1. The correlationvariable can represent the degree of correlation between the words inthe combination of words. Words can correlate based on sharedattributes. For example, the words “wet, dank, and moist” when seentogether can create a correlation based on the accepted attributes ofthe words or phrases.

Incongruity detector 206 can also calculate a frequency variable for thecombination of words using the information in knowledgebase 108. Thefrequency variable can be a value between 0 and 1. The frequencyvariable can represent how frequently the combination of words occurs.

Words that appear together most frequently can have a higher score. Forexample, words that are frequently used together like “such as” or “inbetween” can score higher as they are seen together more often. Lowerfrequencies can indicate an incongruity between common use (e.g., what'sexpected) and uncommon use (e.g., what's novel or incongruous).

Incongruity detector 206 can determine the incongruity score for thecombination of words based on a combination of the collocation variable,the correlation variable, and the frequency variable. The incongruityscore for the combination of words can be a value between 0 and 1.Incongruity detector 206 can output the one or more incongruity scoresto emotion engines 208 and/or compiler 218.

Emotion engines 208 can receive the POS set and the BOW from linguisticanalyzer 204. Emotion engines 208 can also receive the one or moreincongruity scores from incongruity detector 206. Emotion engines 208can include humor engine 210, fear engine 212, euphoria engine 214, anddysphoria engine 216. Each emotion engine in emotion engines 208 canprocess the POS set, the BOW, and/or the one or more incongruity scores.Each engine can produce a preliminary emotion detection score for itscorresponding emotion. Emotion engines 208 may also utilize the receivedthe one or more incongruity scores to adjust the preliminary emotiondetection score in order to provide a more nuanced score.

Humor engine 210 can detect whether humor is present in the message.Fear engine 212 can detect whether fear is present in the message.Euphoria engine 214 can detect whether euphoria is present in themessage. Dysphoria engine 216 can detect whether dysphoria is present inthe message. The preliminary emotion detection scores produced by thesefour emotion engines can be combined to determine a variety of otherhuman emotions, including but not limited to love, avarice, shame,contempt, disgust, sadness, surprise. etc. However, as would beappreciated by a person of ordinary skill, emotion engines 208 caninclude other emotion engines to directly determine other humanemotions.

Humor engine 210, fear engine 212, euphoria engine 214, and dysphoriaengine 216 can each have a corresponding model for their respectiveemotion. In other words, each engine can analyze the POS set and/or theBOW differently based on their corresponding model.

Each engine of emotion engines 208 can be structured as a set ofdetectors. Each detector can receive the POS set, the BOW, and/or theone or more incongruity scores and produce a detector specific score.Each detector can look for indicators of emotional significance in thePOS set and/or the BOW. Each detector can also look for indicators ofemotional significance based on the one or more incongruity scores.

Each engine can combine its detector specific scores together accordingto its own heuristics to produce a preliminary emotion detection score.By way of example, and not limitation, this process is described forhumor engine 210 in FIG. 3 . Emotion engines 208 outputs the preliminaryemotion detection scores to compiler 218.

Compiler 218 can receive the preliminary emotion detection scores fromemotion engines 208. Compiler 218 can also receive the incongruityscores from incongruity detector 206.

Compiler 218 can apply different outcome functions based on thepreliminary emotion detection scores and the incongruity scores. Eachoutcome function can generate a final emotion detection score for aparticular emotion.

An outcome function can generate a final emotion detection score for aparticular emotion by combining a corresponding preliminary emotiondetection score with the incongruity scores according to variousheuristics. An outcome function can also generate a final emotiondetection score for an emotion not represented by an emotion engine inemotion engines 208 by combining multiple preliminary emotion detectionscores with the incongruity scores according to various heuristics.

An outcome function can generate a final emotion detection score for aparticular emotion by adjusting the inputs (e.g., the one or morepreliminary emotion detection scores and the incongruity scores)according to various heuristics. For example, the outcome function cangenerate a final emotion detection score for a particular emotion bytaking a weighted average of the inputs to produce a final emotiondetection score.

Compiler 218 can also determine whether a final emotion detection scoreis above a detection threshold value. If yes, compiler 218 can returnthe final emotion detection score to client device 102. As would beappreciated by a person of ordinary skill in the art, compiler 218 canreturn multiple final emotion detection scores to client device 102.

Compiler 218 can also determine whether a final emotion detection scoreis above a machine learning threshold value. If yes, compiler 218 canprovide the final emotion detection score to trainer 220. Trainer 220can use the final emotion detection score to train the emotion enginesin emotion engines 208. Trainer 220 can train the emotion engines inemotion engines 208 using machine learning techniques as would beappreciated by a person of ordinary skill in the art.

FIG. 3 is a block diagram of humor engine 210 for detecting humor in amessage, according to some embodiments. FIG. 3 is described withreference to FIGS. 1 and 2 . Humor engine 210 can include contextualclue module 302, frame of reference module 304, and personal framemodule 306. As would be appreciated by a person of ordinary skill in theart, an other engine in emotion engines 208 (e.g., fear engine 212,euphoria engine 214, and dysphoria engine 216) can include a contextualclue module 302, a frame of reference module 304, and a personal framemodule 306.

Humor engine 210 can determine a preliminary emotion detection score forhumor for the message using an objective humor model. The objectivehumor model can represent humor as a communication process between asender and a receiver. The objective humor model can involve the sendercreating a message that is intended to have a desired effect on thereceiver.

Using the objective humor model, humor engine 210 can determine apreliminary emotion detection score for humor for the message based oncontextual clues in the message, a frame of reference for the message,and a personal frame of reference for the receiver (e.g., a user). Thecontextual clues can be inherent in the message (e.g., word play orinnuendo). The frame of reference can be implied by text of the message(e.g., movie lines, song lyrics, common jokes, and shared experiences).The personal frame can indicate “How clever is the message?”, “How wematch in our cohort information?”, and “How offended am I?”. Thepersonal frame of reference for the receiver (e.g., a user) candetermine if the receiver accepts or rejects the humor based on theirpersonal preferences. For example, the personal frame of reference cancause a user to reject humor because they either “don't get it” or areoffended. The personal frame of reference for the receiver can alsodetermine if the receiver understands the clues and references in thecommunication. The personal frame of reference for the receiver can alsodetermine how closely the receiver's frame of reference aligns with thesender of the message. The attributes making up the personal frame ofreference can be preset. However, the attributes can also be learnedover time as would be appreciated by a person of ordinary skill in theart.

Humor engine 210 can determine the contextual clues using contextualclue module 302. Humor engine 210 can determine the frame of referenceusing frame of reference module 304. Humor engine 210 can determine thepersonal frame of reference using personal frame module 306.

Contextual clue module 302, frame of reference module 304, and personalframe module 306 can each contain different detectors. Each detector incontextual clue module 302, frame of reference module 304, and personalframe module 306 can calculate a corresponding detector score. Humorengine 210 can combine the detection scores from the contextual cluemodule 302 to produce a contextual clue score (e.g., the number ofcontextual clues). Humor engine 210 can combine the detector scores fromthe frame of reference module 304 to produce a frame of reference score.Humor engine 210 can combine the detector scores from the personal frameof reference module 306 to produce a personal frame of reference score.Humor engine 210 can then combine the contextual clue score, the frameof reference score, and the personal frame of reference score to producethe preliminary emotion detection score for humor engine 210.

FIG. 4 is a block diagram of contextual clue module 302 for determininga contextual clue score for a message, according to some embodiments.FIG. 4 is described with reference to FIGS. 1, 2, and 3 . Contextualclue module 302 can include word choice detector 402, word orderdetector 404, and obscure reference detector 406.

Contextual clues can be clues that can be derived from a message itself.Contextual clue module 302 can combine the detection scores from wordchoice detector 402, word order detector 404, and obscure referencedetector 406 into a contextual clues score. For example, contextual cluemodule 302 can sum the detection scores from word choice detector 402,word order detector 404, and obscure reference detector 406 into thecontextual clues score.

Contextual clues can be word choice in the message. These can be thewords used to communicate in the message. In a visual medium, wordchoice can be referred to as visual choice.

Word choice detector 402 can detect whether the words in the message areindicative of humor. Word choice detector 402 can detect whether thewords in the message are indicative of humor using the information inknowledgebase 108.

Contextual clues can also be word order in the message. Word order canbe the order that words appear in the message. The order of words canprovide contextual clues as to the presence of humor. The order of wordscan also indicate that the sender was intending to send a humorousmessage. Word order detector 404 can detect whether the order of thewords used in the message are indicative of humor. Word order detector404 can detect whether the order of the words used in the message areindicative of humor using the information in knowledgebase 108.

Contextual clues can also be the number of obscure references in themessage. The number of obscure references can be a contextual clue thatthe sender is trying to be “clever,” and therefore humorous. Obscurereference detector 404 can detect the number of obscure references usedin the message. Obscure reference detector 404 can detect the number ofobscure references used in the message using the information inknowledgebase 108.

FIG. 5 is a block diagram of frame of reference module 304 fordetermining a frame of reference score for a message, according to someembodiments. FIG. 5 is described with reference to FIGS. 1-4 . Frame ofreference module 304 can include sender likelihood of humor detector502, presence of theory detector 504, convention detector 506, andreference detector 508.

The frame of reference can represent clues that can be derived from themessage and from external sources. Frame of reference module 304 cancombine the detection scores from sender likelihood of humor detector502, presence of theory detector 504, convention detector 506, andreference detector 508 into a frame of reference score. For example,frame of reference module 304 can sum the detection scores from senderlikelihood of humor detector 502, presence of theory detector 504,convention detector 506, and reference detector 508 into the frame ofreference score.

Sender likelihood of humor detector 502 can detect the sender'sproclivity to use humor. Sender likelihood of humor detector 502 canmake this determination based on previous information captured about thesender. For example, sender likelihood of humor detector 502 can makethis determination based on previous communications between the senderand the receiver.

Sender likelihood of humor detector 502 can make this determinationbased on all previously recorded messages and the total of number oftimes those inputs were humor. On first contact with a new sender,sender likelihood of humor detector 502 can assume the likelihood thenew sender is using humor is 50/50. Sender likelihood of humor detector502 can then change the percentage for each instance learned about thesender. For example, if 30% of the new sender's communications aredetected as containing humor, sender likelihood of humor detector 502can return a likelihood of 30%. Senders can be identified by their useridentifiers (IDs). A user ID can be assigned to a sender based on phonedevice, phone operating system, interne protocol (IP) address, socialmedia account, user session variables (e.g., web browser cookies), orother techniques as would be appreciated by a person of ordinary skillin the art. In the absence of previous information about the sender,sender likelihood of humor detector 502 can return a detection score of50%, for example. This can indicate that the sender has a 50%probability of using humor in a given normal communication.

Presence of theory detector 504 can detect the number of theoreticalapplications for the message. The number of theoretical applications canrepresent the number of times in the message the sender used incongruitytheory, superiority theory, or relief theory. For example, humor can bea benign incongruity of logic. Therefore, detection of an incongruitycan indicate the presence of incongruity theory. Humor can be anexpression of superiority of one over another. Detection of the presenceof first pronouns, second personal pronouns, exclamations, zoomorphiccomparisons, etc. can indicate the presence of superiority theory. Humorcan be an expression of psychological relief of tension. Detection ofthe presence of an expression of psychological relief of tension canindicate the presence of relief theory. As would be appreciated by aperson of ordinary skill in the art, presence of theory detector 504 candetect other types of theoretical applications for the message. Presenceof theory detector 504 can return the number of theoretical applicationsfor the message as its detection score.

Convention detector 506 can detect the number of conventions of humorused in the message. For example, convention detector 506 can detect thenumber of known-structures of humor in the message, such as jokestructures, joke types, and other models of humor. Convention detector506 can detect the number of conventions of humor using the informationin knowledgebase 108. Convention detector 506 can return the number ofconventions of humor used in the message as its detection score.

Reference detector 508 can detect the number of references used in themessage. For example, reference detector 508 can detect the number ofdirect quotations from works such as movies or pop culture used in themessage. Reference detector 508 can detect the number of references usedin the message using the information in knowledgebase 108. Referencedetector 508 can return the number of references used in the message asits detection score.

FIG. 6 is a block diagram of personal frame module 306 for determining apersonal frame for a receiver of a message, according to someembodiments. FIG. 6 is described with reference to FIGS. 1-5 . Personalframe module 306 can include obscurity module 602, narrowness of framemodule 604, likelihood of cohort match detector 606, and insultingmodule 608.

Personal frame module 306 can combine the detection scores for obscuritymodule 602, narrowness of frame module 604, likelihood of cohort matchdetector 606, and insulting module 608 into a personal frame score. Forexample, personal frame module 306 can sum the detection scores of theobscurity module 602, the narrowness of frames module 604, and thelikelihood of cohort match detector 606. Personal frame module 306 canthen divide the sum by the detection score of the insulting module 608to produce the personal frame score.

Obscurity module 602 can detect the complexity of the message. Thecomplexity of the message can indicate the likelihood that the receiverunderstands and appreciate the humor in the message. In other words, themore complex the message, the more likely the joke is obscure. The moreobscure the joke, the less likely it is for the receiver to understandand appreciate the humor in the message.

Obscurity module 602 can include multiple detectors. Obscurity module602 can calculate a detection score indicating a degree of obscurity ofthe message based on the result of each of its detectors. Obscuritymodule 602 can include a detector to detect an obscurity in the message.Obscurity module 602 can include a detector to count the number ofconventions in the message. Obscurity module 602 can include a detectorto count the number of humor theories used in the message. Obscuritymodule 602 can sum the detection scores from the three detectorstogether to produce detection score indicating a degree of obscurity ofthe message.

Narrowness of frame module 604 can calculate a narrowness valuerepresenting how likely it is for a joke or humor to be understood by ashared cohort. Narrowness of frame module 604 can calculate narrownessas the number of references divided by the number of conventions. Thisnarrowness value can represent the window in which cohorts might detecthumor. The more references per convention can result in a narrowing ofthe window in which cohorts might detect humor.

For example, consider the comedian Dennis Miller. He uses extremelyobscure references and multiple humor conventions. As a result, he isgenerally understood by receivers with a much narrower cohort than othercomedians.

Narrowness of frame module 604 can include multiple detectors.Narrowness of frame module 604 can include a detector to count of thenumber of references in the message. Narrowness of frame module 604 canalso include a detector to count of the number of conventions in themessage. Narrowness of frame module 604 can then divide the number ofreferences by the number of conventions to produce detection scoreindicating how likely it is for a joke or humor to be understood by ashared cohort.

Likelihood of cohort match detector 606 can calculate the probabilitythat there is a cohort match. This can be based on the proposition thatpeople are more likely to understand humor if their personal framesalign. Likelihood of cohort match detector 606 can calculate theprobability that the sender and receiver are in the same cohort. Thehigher similarity, the higher the likelihood that the sender andreceiver will understand each other. Likelihood of cohort match detector606 can perform the cohort matching based on user attributes such asage, sex, race, geographic location, political affiliation, religion,psychology (e.g., affinity or behavioral categories), known predictorsof attributes (e.g., people who like movie genre A are also 90% likelyto prefer music genre B), or other factors as would be appreciated by aperson of ordinary skill in the art. Likelihood of cohort match detector606 can make this determination for both the sender and receiver.Likelihood of cohort match detector 606 can determine the probability(or match score) by summing all matching information. A higher sum canindicate a greater likelihood of a cohort match. Each attribute that isshared can increase the likelihood that both parties understand messageswith others in their cohort.

As would be appreciated by a person of ordinary skill in the art, somejokes or humor may not be understood by a receiver. Some jokes or humormay also offend or elicit anger from the receiver. Personal frame module306 can take this into account by calculating the personal frame scorebased on a detection score from the insulting module 608 to produce thepersonal frame score. For example, personal frame module 306 cancalculate the personal frame score by dividing the sum of the detectorscores from obscurity module 602, narrowness of frame module 604, andlikelihood of cohort match detector 606 by the detector score frominsulting module 608 to produce the personal frame score.

Because an insult can render the sender's intent in the message null andvoid, personal frame module 306 can make the detector score frominsulting module 608 the denominator of the formula for calculating thepersonal frame score. This is because making it the denominator cannegate the entire personal frame. If the receiver isn't insulted, thenthe preliminary emotion detection score for humor is simply the cluesencoded by the sender (e.g., the detection scores from obscurity module602, narrowness of frames module 604, and likelihood of cohort matchdetector 606). Moreover, for the sender, there can be no insultotherwise they wouldn't make the joke and the message wouldn't be sent.This does not mean it cannot be insulting, but it doesn't preclude thesender from sending the message.

Insulting module 608 can take inputs as simple yes or no (e.g., binary 0or 1). Zero can indicate “yes, it is an insult,” and 1 can indicate “no,it is not insulting enough to be offensive.” Insulting module 608 caninclude a detector that determines if the receiver is the subject of ajoke. Insulting module 608 can include a detector that determines if thesender is implying their superiority. Insulting module 608 can include adetector that determines if there is a presence of racism, sexism,bigotry, etc. that is offensive to the receiver. Each detector outputs 0or 1 depending on the presence of an insult. As would be appreciated bya person of ordinary skill in the art, each receiver can have differenttolerances for these factors.

As described above, personal frame module 306 can combine the detectionscores for obscurity module 602, narrowness of frame module 604,likelihood of cohort match detector 606, and insulting module 608 into asingle personal frame score. Personal frame module 306 can sum thedetection scores of obscurity module 602, narrowness of frames module604, and the likelihood of cohort match detector 606. Personal framemodule 306 can then divide the sum by the detection score from insultingmodule 608 to produce the personal frame score.

By way of example, contextual clue module 302 can first calculate acontextual clue score. For example, obscure reference detector 406 cancalculate the number of obscure references in the message. For example,the number of obscure references can be 2. Word choice detector 402 cancalculate the number of word choice incongruities. Word choice detector402 can calculate the number of word choice incongruities based onvarious factors as would be appreciated by a person of ordinary skill inthe art. For example, the number of word choice incongruities can be 0.Word order detector 404 can calculate the number of word orderincongruities. Word choice detector 402 can calculate the number of wordorder incongruities based on various factors as would be appreciated bya person of ordinary skill in the art. For example, the number of wordorder incongruities can be 1. Thus, the contextual clue score can be sumof the number of obscure reference (e.g., 2) and the number of wordorder incongruities (e.g., 1) which totals to 3.

Word choice detector 402 can calculate the number of word choiceincongruities based on words and phrases with duplicitous meaning, suchas, but not limited to, metaphors, homographs, homophones, etc. Ahomograph can be a duplicitous lingual device in which hidden meaningcan be encoded. A homograph can be used in humor to signal anincongruity by use of dual meanings. For example, consider the message“I was hoping to steal some leftovers from the party but I guess myplans were foiled.” In this message, foil can be a term representing amaterial used for wrapping leftovers but it can also be a term for whena crime is stopped in the process of being committed. The use of a word(e.g., foil) with multiple meanings can be a reliable indicator that thesender is using humor. Word choice detector 402 can detect a word choiceincongruity based on this homograph.

Word choice detector 402 can also calculate the number of word choiceincongruities based on shared attributes or overloaded meaning. Forexample, in the above message, word choice detector 402 can detect aword choice incongruity based on “foiled.” This is because an attributeof leftovers can be aluminum foil. The word “foil” can also becorrelated with the word “steal.” Thus, there can be a shared attributewith leftovers.

Word choice detector 402 can also calculate the number of word choiceincongruities based on the presence of different types of pronoun. Forexample, in the above message, word choice detector 402 can detect aword choice incongruity based on the first person pronouns of “I” and“my.”

Word order detector 404 can calculate the number of word orderincongruities based on a signifier. For example, in the above message,word choice detector 402 can detect a word order incongruity based onthe signifier “foiled” appearing last in the sentence. Frame ofreference module 304 can then calculate a frame of reference score. Forexample, sender likelihood of humor detector 502 can calculate thesender likelihood of humor. Sender likelihood of humor detector 502 canstart the sender likelihood of humor at 50/50 and then adjust the senderlikelihood of humor based on learning from interactions with the sender.For example, the sender likelihood of humor can eventually be determinedto be 80% based on learning from interactions with the sender. Presenceof theory detector 504 can calculate the number of theoreticalapplications for the message. For example, the number of theoreticalapplications can be 1, which could represent a presence of anincongruity theory, superiority theory, or relief theory. Conventiondetector 506 can calculate the number of conventions of humor used inthe message. For example, the number of conventions of humor can be 1.In the case of humor, conventions can be a set of narrative formats orstructures that are archetypical to the practice of comedy. For example,conventions can include, but are not limited to, The Rule of Threes, The180, Fish out-of Water, and Absurdity. Reference detectors 508 cancalculate the number of references used in the message. For example, thenumber of references can be 0. Thus, the frame of reference score can bethe sum of the sender likelihood of humor (e.g., 0.80), the number oftheoretical applications (e.g., 1), and the number of conventions ofhumor used in the message (e.g., 1) which totals to 2.8.

Personal frame module 306 can then calculate the personal frame score.For example, obscurity module 602 can calculate the obscurity score.Obscurity module 602 can calculate the number recognized obscurities.For example, the number of recognized obscurities can be 0. Obscuritymodule 602 can calculate the number of conventions. For example, thenumber of conventions can be 1. Obscurity module 602 can calculate thenumber of humor theories used. For example, the number of humor theoriescan be 1. Thus, the obscurity score can be the sum of the numberrecognized obscurities (e.g., 0), the number of conventions (e.g., 1),and the number of humor theories (e.g., 1) which totals to 2.

Narrowness of frame module 604 can calculate the narrowness score basedon the number of references and the number of conventions. For example,the number of references can be 0 and the number of conventions canbe 1. Thus, the narrowness score can be the result of dividing thenumber of references (e.g., 0) by the number of conventions (e.g., 1)which is 0.

Likelihood of cohort match detector 606 can calculate the cohortlikelihood score. For example, the cohort likelihood score can be 2.Likelihood of cohort match detector 606 can calculate the cohortlikelihood score based on various factors such as, but not limited to,age, sex, race, geographic location, political affiliation, religion, orother factors as would be appreciated by a person of ordinary skill inthe art.

Insulting module 608 can calculate the insult score. For example, theinsult score can be 1 (e.g., no insult). Insulting module 610 cancalculate the insult score based on if the receiver is the subject of ajoke, if the sender is implying their superiority, or if there is apresence of racism, sexism, bigotry, etc. that is offensive to thereceiver.

Personal frame module 306 can calculate the personal frame score basedon the sum of the detection scores of obscurity module 602, narrownessof frame module 604, likelihood of cohort match detector 606. The sumcan be 4. Personal frame module 306 can then divide the sum by theinsult score of 1. Thus, the personal frame score can be 4.

Humor engine 210 can then sum the contextual clue score (e.g., 3) andthe frame of reference score (e.g., 2.8), and divide the result by thepersonal frame score (e.g., 4). The resulting preliminary emotiondetection score for humor can be 5.8/4=1.45. This preliminary emotiondetection score for humor can represent the degree which both the senderand receiver communicate humor without misinterpretation.

Compiler 218 can receive the preliminary emotion detection score forhumor from humor engine 210. Compiler 218 can also receive one or moreincongruity scores from incongruity detector 206. Compiler 218 can thenapply an outcome function based on the preliminary emotion detectionhumor score and the incongruity scores. Compiler 218 can also apply anoutcome function based on just the one or more incongruity scores. Theoutcome function can generate one or more final emotion detection scores(e.g., a final emotion detection score for humor). For example, theoutcome function can generate a final emotion detection score for humorof 99% likely. This may be based on an incongruity of 85% likely, 5contextual clues, 3.5 frames, and a 4.5 personal frame.

FIG. 7 is a flowchart for a method 700 for detecting a human emotion ina message from a user, according to an embodiment. Method 700 can beperformed by processing logic that can comprise hardware (e.g.,circuitry, dedicated logic, programmable logic, microcode, etc.),software (e.g., instructions executing on a processing device), or acombination thereof. It is to be appreciated that not all steps may beneeded to perform the disclosure provided herein. Further, some of thesteps may be performed simultaneously, or in a different order thanshown in FIG. 7 , as will be understood by a person of ordinary skill inthe art.

Method 700 shall be described with reference to FIGS. 1-6 . However,method 700 is not limited to that example embodiment.

In 702, sensor 202 receives a message. Sensor 202 can receive themessage from a user of client device 102. Sensor 202 can receive themessage using an API such as, but not limited to, the REST API. Sensor102 can receive the message in various formats such as, but not limitedto, text data, audio data, or visual data.

In 704, linguistic analyzer 204 labels each word of the message with apart of speech (POS) thereby creating a POS set.

In 706, linguistic analyzer 204 creates a bag of words (BOW) for themessage.

In 708, incongruity detector 206 determines an incongruity score for acombination of words in the POS set using knowledgebase 108. As would beappreciated by a person of ordinary skill in the art, incongruitydetector 206 can determine incongruity scores for various combinationsof words in the POS set based on knowledgebase 108.

Incongruity detector 206 can determine an incongruity score for acombination of words in the POS set by calculating different variablesfor the combination of words using the information in knowledgebase 108.Incongruity detector 206 can calculate a collocation variable, acorrelation variable, or a frequency variable. Incongruity detector 206can determine the incongruity score for the combination of words basedon a combination of the collocation variable, the correlation variable,and the frequency variable.

In 710, an emotion engine in emotion engines 208 determines apreliminary emotion detection score for a corresponding emotion for themessage based on the POS set and the BOW. The emotion engine in emotionengines 208 can also determine the preliminary emotion detection scorebased on the incongruity score of 708. As would be appreciated by aperson of ordinary skill in the art, other emotion engines than thoseincluded within emotion engines 208 can determine correspondingpreliminary emotion detection scores for their emotions based on the POSset and the BOW.

In 712, compiler 218 calculates a final emotion detection score for anemotion for the message based on the preliminary emotion detection scoreand the incongruity score. As would be appreciated by a person ofordinary skill in the art, compiler 218 can calculate final emotiondetection scores for other emotions for the message based on otherpreliminary emotion detection scores and the incongruity score.

Various embodiments may be implemented, for example, using one or morewell-known computer systems, such as computer system 800 shown in FIG. 8. One or more computer systems 800 may be used, for example, toimplement any of the embodiments discussed herein, as well ascombinations and sub-combinations thereof.

Computer system 800 may include one or more processors (also calledcentral processing units, or CPUs), such as a processor 804. Processor804 may be connected to a communication infrastructure or bus 806.

Computer system 800 may also include user input/output device(s) 803,such as monitors, keyboards, pointing devices, camera, microphone, brainimaging device, etc., which may communicate with communicationinfrastructure 806 through user input/output interface(s) 802.

One or more of processors 804 may be a graphics processing unit (GPU).In an embodiment, a GPU may be a processor that is a specializedelectronic circuit designed to process mathematically intensiveapplications. The GPU may have a parallel structure that is efficientfor parallel processing of large blocks of data, such as mathematicallyintensive data common to computer graphics applications, images, videos,etc.

Computer system 800 may also include a main or primary memory 808, suchas random access memory (RAM). Main memory 808 may include one or morelevels of cache. Main memory 808 may have stored therein control logic(i.e., computer software) and/or data.

Computer system 800 may also include one or more secondary storagedevices or memory 810. Secondary memory 810 may include, for example, ahard disk drive 812 and/or a removable storage device or drive 814.Removable storage drive 814 may be a floppy disk drive, a magnetic tapedrive, a compact disk drive, an optical storage device, tape backupdevice, and/or any other storage device/drive.

Removable storage drive 814 may interact with a removable storage unit818. Removable storage unit 818 may include a computer usable orreadable storage device having stored thereon computer software (controllogic) and/or data. Removable storage unit 818 may be a floppy disk,magnetic tape, compact disk, DVD, optical storage disk, and/or any othercomputer data storage device. Removable storage drive 814 may read fromand/or written to removable storage unit 818.

Secondary memory 810 may include other means, devices, components,instrumentalities or other approaches for allowing computer programsand/or other instructions and/or data to be accessed by computer system800. Such means, devices, components, instrumentalities or otherapproaches may include, for example, a removable storage unit 822 and aninterface 820. Examples of the removable storage unit 822 and theinterface 820 may include a program cartridge and cartridge interface(such as that found in video game devices), a removable memory chip(such as an EPROM or PROM) and associated socket, a memory stick and USBport, a memory card and associated memory card slot, and/or any otherremovable storage unit and associated interface.

Computer system 800 may further include a communication or networkinterface 824. Communication interface 824 may enable computer system800 to communicate and interact with any combination of externaldevices, external networks, external entities, etc. (individually andcollectively referenced by reference number 828). For example,communication interface 824 may allow computer system 800 to communicatewith external or remote devices 828 over communications path 826, whichmay be wired and/or wireless (or a combination thereof), and which mayinclude any combination of LANs, WANs, the Internet, etc. Control logicand/or data may be transmitted to and from computer system 800 viacommunication path 826.

Computer system 800 may also be any of a personal digital assistant(PDA), desktop workstation, laptop or notebook computer, netbook,tablet, smart phone, smart watch or other wearable, appliance, part ofthe Internet-of-Things, and/or embedded system, to name a fewnon-limiting examples, or any combination thereof.

Computer system 800 may be a client or server, accessing or hosting anyapplications and/or data through any delivery paradigm, including butnot limited to remote or distributed cloud computing solutions; local oron-premises software (“on-premise” cloud-based solutions); “as aservice” models (e.g., content as a service (CaaS), digital content as aservice (DCaaS), software as a service (SaaS), managed software as aservice (MSaaS), platform as a service (PaaS), desktop as a service(DaaS), framework as a service (FaaS), backend as a service (BaaS),mobile backend as a service (MBaaS), infrastructure as a service (IaaS),etc.); and/or a hybrid model including any combination of the foregoingexamples or other services or delivery paradigms.

Any applicable data structures, file formats, and schemas in computersystem 800 may be derived from standards including but not limited toJavaScript Object Notation (JSON), Extensible Markup Language (XML), YetAnother Markup Language (YAML), Extensible Hypertext Markup Language(XHTML), Wireless Markup Language (WML), MessagePack, XML User InterfaceLanguage (XUL), or any other functionally similar representations aloneor in combination. Alternatively, proprietary data structures, formatsor schemas may be used, either exclusively or in combination with knownor open standards.

In some embodiments, a tangible, non-transitory apparatus or article ofmanufacture comprising a tangible, non-transitory computer useable orreadable medium having control logic (software) stored thereon may alsobe referred to herein as a computer program product or program storagedevice. This includes, but is not limited to, computer system 800, mainmemory 808, secondary memory 810, and removable storage units 818 and822, as well as tangible articles of manufacture embodying anycombination of the foregoing. Such control logic, when executed by oneor more data processing devices (such as computer system 800), may causesuch data processing devices to operate as described herein.

Based on the teachings contained in this disclosure, it will be apparentto persons skilled in the relevant art(s) how to make and useembodiments of this disclosure using data processing devices, computersystems and/or computer architectures other than that shown in FIG. 8 .In particular, embodiments can operate with software, hardware, and/oroperating system implementations other than those described herein.

It is to be appreciated that the Detailed Description section, and notany other section, is intended to be used to interpret the claims. Othersections can set forth one or more but not all exemplary embodiments ascontemplated by the inventor(s), and thus, are not intended to limitthis disclosure or the appended claims in any way.

While this disclosure describes exemplary embodiments for exemplaryfields and applications, it should be understood that the disclosure isnot limited thereto. Other embodiments and modifications thereto arepossible, and are within the scope and spirit of this disclosure. Forexample, and without limiting the generality of this paragraph,embodiments are not limited to the software, hardware, firmware, and/orentities illustrated in the figures and/or described herein. Further,embodiments (whether or not explicitly described herein) havesignificant utility to fields and applications beyond the examplesdescribed herein.

Embodiments have been described herein with the aid of functionalbuilding blocks illustrating the implementation of specified functionsand relationships thereof. The boundaries of these functional buildingblocks have been arbitrarily defined herein for the convenience of thedescription. Alternate boundaries can be defined as long as thespecified functions and relationships (or equivalents thereof) areappropriately performed. Also, alternative embodiments can performfunctional blocks, steps, operations, methods, etc. using orderingsdifferent than those described herein.

References herein to “one embodiment,” “an embodiment,” “an exampleembodiment,” or similar phrases, indicate that the embodiment describedcan include a particular feature, structure, or characteristic, butevery embodiment can not necessarily include the particular feature,structure, or characteristic. Moreover, such phrases are not necessarilyreferring to the same embodiment. Further, when a particular feature,structure, or characteristic is described in connection with anembodiment, it would be within the knowledge of persons skilled in therelevant art(s) to incorporate such feature, structure, orcharacteristic into other embodiments whether or not explicitlymentioned or described herein. Additionally, some embodiments can bedescribed using the expression “coupled” and “connected” along withtheir derivatives. These terms are not necessarily intended as synonymsfor each other. For example, some embodiments can be described using theterms “connected” and/or “coupled” to indicate that two or more elementsare in direct physical or electrical contact with each other. The term“coupled,” however, can also mean that two or more elements are not indirect contact with each other, but yet still co-operate or interactwith each other.

The breadth and scope of this disclosure should not be limited by any ofthe above-described exemplary embodiments, but should be defined only inaccordance with the following claims and their equivalents.

What is claimed is:
 1. A computer implemented method for detecting humorin an electronic message, comprising: labeling, by at least oneprocessor, each word of the electronic message with a part of speech(POS) thereby creating a POS set; determining an incongruity score for acombination of words in the POS set based on a collocation variable anda correlation variable for the combination of words in the POS set;determining a preliminary emotion detection score for humor in theelectronic message based on a contextual clue score for the electronicmessage, a frame of reference score for the electronic message, and apersonal frame of reference score for a receiver of the electronicmessage; calculating a final emotion detection score for humor in theelectronic message based on the preliminary emotion detection score andthe incongruity score; and outputting an indication that humor ispresent in the electronic message based on the final emotion detectionscore.
 2. The computer-implemented method of claim 1, wherein thedetermining the preliminary emotion detection score for humor in theelectronic message further comprises: determining the contextual cluescore based on a word in the electronic message being indicative ofhumor, an ordering of words in the electronic message, or a number ofobscure references in the electronic message.
 3. Thecomputer-implemented method of claim 1, wherein the determining thepreliminary emotion detection score for humor in the electronic messagecomprises: determining the frame of reference score based on a number oftimes that a sender of the electronic message previously used humor inother messages to the receiver, a number of times the sender usedincongruity theory, superiority theory, or relief theory in theelectronic message, a number of conventions of humor in the electronicmessage, or a number of quotations used in the electronic message. 4.The computer-implemented method of claim 1, wherein the determining thepreliminary emotion detection score for humor in the electronic messagecomprises: determining the personal frame of reference score based on acomplexity score representing a degree of complexity of the electronicmessage, an obscurity score representing a degree of obscurity of theelectronic message, a cohort likelihood score, or a number of insults inthe electronic message.
 5. The computer-implemented method of claim 1,wherein the calculating the final emotion detection score for humor inthe electronic message comprises: applying an outcome function to thepreliminary emotion detection score and the incongruity score, whereinthe outcome function calculates a weighted average of the preliminaryemotion detection score and the incongruity score.
 6. The computerimplemented method of claim 1, further comprising: calculating thecollocation variable for the combination of words in the POS set basedon a knowledgebase; and calculating the correlation variable for thecombination of words in the POS set based on the knowledgebase.
 7. Thecomputer-implemented method of claim 1, wherein the determining theincongruity score comprises: determining the incongruity score for thecombination of words in the POS set based on a frequency variable forthe combination of words in the POS set.
 8. A system for detecting humorin an electronic message, comprising: a memory; and at least oneprocessor coupled to the memory and configured to: label each word ofthe electronic message with a part of speech (POS) thereby creating aPOS set; determine an incongruity score for a combination of words inthe POS set based on a collocation variable and a correlation variablefor the combination of words in the POS set; determine a preliminaryemotion detection score for humor in the electronic message based on acontextual clue score for the electronic message, a frame of referencescore for the electronic message, and a personal frame of referencescore for a receiver of the electronic message; calculate a finalemotion detection score for humor in the electronic message based on thepreliminary emotion detection score and the incongruity score; andoutput an indication that humor is present in the electronic messagebased on the final emotion detection score.
 9. The system of claim 8,wherein to determine the preliminary emotion detection score for humorin the electronic message, the at least one processor is furtherconfigured to: determine the contextual clue score based on a word inthe electronic message being indicative of humor, an ordering of wordsin the electronic message, or a number of obscure references in theelectronic message.
 10. The system of claim 8, wherein to determine thepreliminary emotion detection score for humor in the electronic message,the at least one processor is further configured to: determine the frameof reference score based on a number of times that a sender of theelectronic message previously used humor in other messages to thereceiver, a number of times the sender used incongruity theory,superiority theory, or relief theory in the electronic message, a numberof conventions of humor in the electronic message, or a number ofquotations used in the electronic message.
 11. The system of claim 8,wherein to determine the preliminary emotion detection score for humorin the electronic message, the at least one processor is furtherconfigured to: determine the personal frame of reference score based ona complexity score representing a degree of complexity of the electronicmessage, an obscurity score representing a degree of obscurity of theelectronic message, a cohort likelihood score, or a number of insults inthe electronic message.
 12. The system of claim 8, wherein to calculatethe final emotion detection score for humor in the electronic message,the at least one processor is further configured to: apply an outcomefunction to the preliminary emotion detection score and the incongruityscore, wherein the outcome function calculates a weighted average of thepreliminary emotion detection score and the incongruity score.
 13. Thesystem of claim 3, wherein the at least one processor is furtherconfigured to: calculate the collocation variable for the combination ofwords in the POS set based on a knowledgebase; and calculate thecorrelation variable for the combination of words in the POS set basedon the knowledgebase.
 14. The system of claim 8, wherein to determinethe incongruity score, the at least one processor is further configuredto: determine the incongruity score for the combination of words in thePOS set based on a frequency variable for the combination of words inthe POS set.
 15. A non-transitory computer-readable medium havinginstructions stored thereon that, when executed by at least onecomputing device, cause the at least one computing device to performoperations comprising: labeling each word of an electronic message witha part of speech (POS) thereby creating a POS set; determining anincongruity score for a combination of words in the POS set based on acollocation variable and a correlation variable for the combination ofwords in the POS set; determining a preliminary emotion detection scorefor humor in the electronic message based on a contextual clue score forthe electronic message, a frame of reference score for the electronicmessage, and a personal frame of reference score for a receiver of theelectronic message; calculating a final emotion detection score forhumor in the electronic message based on the preliminary emotiondetection score and a incongruity score; and outputting an indicationthat humor is present in the electronic message based on the finalemotion detection score.
 16. The non-transitory computer-readable mediumof claim 15, wherein the determining the preliminary emotion detectionscore for humor in the electronic message comprises: determining thecontextual clue score based on a word in the electronic message beingindicative of humor, an ordering of words in the electronic message, ora number of obscure references in the electronic message.
 17. Thenon-transitory computer-readable medium of claim 13, wherein thedetermining the preliminary emotion detection score for humor in theelectronic message comprises: determining the frame of reference scorebased on a number of times that a sender of the electronic messagepreviously used humor in other messages to the receiver, a number oftimes the sender used incongruity theory, superiority theory, or relieftheory in the electronic message, a number of conventions of humor inthe electronic message, or a number of quotations used in the electronicmessage.
 18. The non-transitory computer-readable medium of claim 15,wherein the determining the preliminary emotion detection score forhumor in the electronic message comprises: determining the personalframe of reference score based on a complexity score representing adegree of complexity of the electronic message, an obscurity scorerepresenting a degree of obscurity of the electronic message, a cohortlikelihood score, or a number of insults in the electronic message. 19.The non-transitory computer-readable medium of claim 15, wherein thecalculating the final emotion detection score for humor in theelectronic message comprises: applying an outcome function to thepreliminary emotion detection score and the incongruity score, whereinthe outcome function calculates a weighted average of the preliminaryemotion detection score and the incongruity score.
 20. Thenon-transitory computer-readable medium of claim 15, wherein theoperations further comprise: calculating the collocation variable forthe combination of words in the POS set based on a knowledgebase; andcalculating the correlation variable for the combination of words in thePOS set based on the knowledgebase.